package com.gulimall.member.web;

import com.common.utils.R;
import com.gulimall.member.feign.OrderFeignService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.annotation.Resource;
import java.util.HashMap;

/**
 * @Author Rookie-6688
 * @Description
 * @Create 2021-05-11 16:13
 */
@Controller
public class MemberWebController {
    @Resource
    private OrderFeignService orderFeignService;

    /**
     * 获取订单列表数据
     * @param pageNum
     * @param model
     * @return
     */
    @GetMapping("/memberOrder.html")
    public String orderList(@RequestParam(defaultValue = "0") Integer pageNum, Model model){
        HashMap<String, Object> params = new HashMap<>();
        params.put("page",pageNum.toString());
        R itemList = orderFeignService.getItemList(params);
        model.addAttribute("orders",itemList);
        return "orderList";
    }
}
